/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.web;

import hope.platform.data.domain.SiteType;
import hope.platform.data.server.data.header.SiteTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/7/16 14:33
 */
@RestController
@RequestMapping("/siteType")
public class SiteTypeController {

    @Autowired
    private SiteTypeService siteTypeService;

    @RequestMapping(method = RequestMethod.POST)
    public SiteType addSiteType(@RequestBody SiteType siteType) throws Exception {
        return siteTypeService.addSiteType(siteType);
    }

    @RequestMapping(method = RequestMethod.PUT)
    public SiteType updateSiteType(@RequestBody SiteType siteType) throws Exception {
        return siteTypeService.updateSiteType(siteType);
    }

    @RequestMapping(value = "/all", method = RequestMethod.GET)
    public List<SiteType> getAllSiteType() throws Exception {
        return siteTypeService.getAllSiteType();
    }
}
